﻿Public Class details
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Function getDate(ByVal dateTime As String) As String
        If (dateTime = "") Then
            Return "Not Published"
        Else
            Dim parts As String() = dateTime.Split(" ")
            Return parts(0)
        End If
    End Function

    Protected Function getPic(ByVal platform As String) As String
        Dim returnString = ""
        Dim parts As String() = platform.Split(" ")
        For Each i In parts
            Select i
                Case "PS3"
                    returnString += "<image src='Images/Platform/PS3.jpg' width='116px' height='37px'> <br />"
                Case "PS2"
                    returnString += "<image src='Images/Platform/PS2.jpg' width='116px' height='37px'> <br />"
                Case "PC"
                    returnString += "<image src='Images/Platform/PC.jpg' width='116px' height='37px'> <br />"
                Case "PSP"
                    returnString += "<image src='Images/Platform/PSP.jpg' width='116px' height='37px'> <br />"
                Case "WII"
                    returnString += "<image src='Images/Platform/WII.jpg' width='116px' height='37px'> <br />"
                Case "WIIU"
                    returnString += "<image src='Images/Platform/WIIU.jpg' width='116px' height='37px'> <br />"
                Case "XBOX360"
                    returnString += "<image src='Images/Platform/XBOX360.jpg' width='116px' height='37px'> <br />"
            End Select
        Next

        Return returnString
    End Function

    Protected Sub btn_ViewComments_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn_ViewComments.Click
        Response.Redirect("Comments/Comment.aspx?ID=" & Request.Params("ID"))
    End Sub

    Protected Sub btn_TagGame_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn_TagGame.Click
        Response.Redirect("Tags/TagGame.aspx?ID=" & Request.Params("ID"))
    End Sub
End Class